/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.shinyray.project.entity;

import com.shinyray.project.bpm.task.entity.ProjectTask;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

/**
 * 项目是一个运营的单元。一个项目包括了项目的基本信息以及相关附件，同时还包括了若干与此项目相关的合作协议。
 * @author Administrator
 */
@Entity
public class Project implements Serializable {
    private static final long serialVersionUID = 1L;
    //项目名称
    private String projectName;
    //项目概述
    private String projectDescription;
    //项目电子表单材料
    @OneToMany(mappedBy = "project")
    private List<ProjectForm> formList;
    //项目附件材料
    @OneToMany
    private List<ProjectAttachment> attachmentList;
    //合作协议
    @OneToMany(mappedBy = "project")
    private List<CPP> cppList;
    //项目状态
    private String status;
    //项目经理
    @OneToMany(mappedBy = "project")
    private List<ProjectManager> projectManagerList;
    //项目的审批流程
    @ManyToOne
    private ProjectApproveProcess approveProcess;
    //项目的审批任务执行情况
    @OneToMany(mappedBy = "project")
    private List<ProjectTask> taskInstanceList;
    //项目应收帐款

    @OneToMany(mappedBy = "project")
    private List<AccountReceivable> accountReceivableList;
    //项目应付帐款
    @OneToMany(mappedBy = "project")
    private List<AccountPayable> accountPayableList;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Project)) {
            return false;
        }
        Project other = (Project) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.shinyray.project.entity.ProjectInfo[id=" + id + "]";
    }

    public List<AccountPayable> getAccountPayableList() {
        return accountPayableList;
    }

    public void setAccountPayableList(List<AccountPayable> accountPayableList) {
        this.accountPayableList = accountPayableList;
    }

    public List<AccountReceivable> getAccountReceivableList() {
        return accountReceivableList;
    }

    public void setAccountReceivableList(List<AccountReceivable> accountReceivableList) {
        this.accountReceivableList = accountReceivableList;
    }

    public ProjectApproveProcess getApproveProcess() {
        return approveProcess;
    }

    public void setApproveProcess(ProjectApproveProcess approveProcess) {
        this.approveProcess = approveProcess;
    }

    public List<ProjectAttachment> getAttachmentList() {
        return attachmentList;
    }

    public void setAttachmentList(List<ProjectAttachment> attachmentList) {
        this.attachmentList = attachmentList;
    }

    public List<CPP> getCppList() {
        return cppList;
    }

    public void setCppList(List<CPP> cppList) {
        this.cppList = cppList;
    }

    public List<ProjectForm> getFormList() {
        return formList;
    }

    public void setFormList(List<ProjectForm> formList) {
        this.formList = formList;
    }

    public String getProjectDescription() {
        return projectDescription;
    }

    public void setProjectDescription(String projectDescription) {
        this.projectDescription = projectDescription;
    }

    public List<ProjectManager> getProjectManagerList() {
        return projectManagerList;
    }

    public void setProjectManagerList(List<ProjectManager> projectManagerList) {
        this.projectManagerList = projectManagerList;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public List<ProjectTask> getTaskInstanceList() {
        return taskInstanceList;
    }

    public void setTaskInstanceList(List<ProjectTask> taskInstanceList) {
        this.taskInstanceList = taskInstanceList;
    }


}
